package models

import (
	database "renter/infrastructure"
)

type Account struct {
	Id         int64  `json:"id"`
	Account    string `json:"account"`
	Password   string `json:"password"`
	UserId     int64  `json:"userId"`
	CreateTime int64  `json:"createTime"`
}

func (a *Account) TableName() string {
	return "tb_account"
}

func SelectAccountByAccount(account string) *Account {
	var result = Account{}
	database.GetDB().Where("account = ?", account).First(&result)
	return &result
}
